#include <stdio.h>
#include <string.h>

int HanMingDistance(char* str1, char* str2, int len)
{
    int distance = 0;
    for(int i = 0; i < len; i++)
    {
        if(str1[i] != str2[i])
        distance++;
    }
    return distance;
}

int main()
{
    int T = 0;
    scanf("%d", &T);
    char arr1[10001] = {0};
    char arr2[10001] = {0};
    char ret[101][10001] = {0};
    for(int k = 0; k < T; k++)
    {
        char* tmp = &ret[k][0];
        scanf("%s", arr1);
        scanf("%s", arr2);
        int len = strlen(arr1);
        tmp[len] = '\0';
        int dice = 0;//输入的两个字符串当前位置起的汉明距离
        int hm1 = 0, hm2 = 0;
        for(int i = 0; i < len; i++)
        {
            if(arr1[i] == arr2[i])
            {
                tmp[i] = 'a';
                continue;
            }
            dice = HanMingDistance(arr1+i, arr2+i, len-i);
            int tem1 = 0, tem2 = 0;
            for(char j = 'a'; j <= 'z'; j++)
            {
                if(arr1[i] != j)
                tem1 = 1;
                else
                tem1 = 0;
                if(arr2[i] != j)
                tem2 = 1;
                else
                tem2 = 0;
                if(hm1 + tem1 - hm2 - tem2 < dice&&hm2 + tem2 - hm1 -tem1 < dice)
                {
                    hm1 = hm1 + tem1;
                    hm2 = hm2 + tem2;
                    tmp[i] = j;
                    break;
                }
            }
        }
    }
    for(int i = 0; i < T; i++)
    {
        printf("Case %d: %s\n", i + 1, ret[i]);
    }
    return 0;
}